package com.zd.service.lmpl;/**
 * @Description: WaybilllistServicelmpl
 * @Author:pioneer
 * @Date: 2021-06-25
 * @Version:v1.0
 */

import com.zd.mapper.WaybilllistMapper;
import com.zd.service.lnter.WaybilllistServicelnter;
import com.zzg.entity.Waybilllist;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: WaybilllistServicelmpl
 * @Author:pioneer
 * @Date: 2021-06-25
 * @Version:v1.0
 */
@Service
public class WaybilllistServicelmpl implements WaybilllistServicelnter {

    @Autowired
    private WaybilllistMapper waybilllistMapper;
    /**
     * 查询所有运单信息
     * @return 运单集合
     */
    @Override
    public List<Waybilllist> querywaybill() {
        return waybilllistMapper.querywaybill ();
    }

    /**
     * 分页查询
     *
     * @param page  页码
     * @param limit 条目数
     * @return 运单集合
     */
    @Override
    public List<Waybilllist> getpaging(int page, int limit) {
        return waybilllistMapper.getpaging ((page-1)*limit,limit);
    }

    /**
     * 动态查询
     *
     * @param consignmentid   托运单号
     * @param consignmentdate 托运日期
     * @param commitmentdate  承诺日期
     * @param origin          出发地
     * @param arrivestation   到达分站
     * @param getcity         到达城市
     * @param forwardingunit  发货公司
     * @param receivingunit   收货公司
     * @param transportid     运输单号
     * @param transportCarid  运输车号
     * @param waybillstatus   运单状态
     * @return 运单集合
     */
    @Override
    public List<Waybilllist> dynamicquery(String consignmentid, String consignmentdate, String commitmentdate, String origin, String arrivestation, String getcity, String forwardingunit, String receivingunit, String transportid, String transportCarid, String waybillstatus) {
        return waybilllistMapper.dynamicquery (consignmentid,consignmentdate,commitmentdate,origin,arrivestation,getcity,forwardingunit,receivingunit,transportid,transportCarid,waybillstatus);
    }

    /**
     * 动态查询分页
     *
     * @param consignmentid   托运单号
     * @param consignmentdate 托运日期
     * @param commitmentdate  承诺日期
     * @param origin          出发地
     * @param arrivestation   到达分站
     * @param getcity         到达城市
     * @param forwardingunit  发货公司
     * @param receivingunit   收货公司
     * @param transportid     运输单号
     * @param transportCarid  运输车号
     * @param waybillstatus   运单状态
     * @param page            页码
     * @param limit           条目数
     * @return 运单集合
     */
    @Override
    public List<Waybilllist> conditionalquery(String consignmentid, String consignmentdate, String commitmentdate, String origin, String arrivestation, String getcity, String forwardingunit, String receivingunit, String transportid, String transportCarid, String waybillstatus, int page, int limit) {
        return waybilllistMapper.conditionalquery (consignmentid,consignmentdate,commitmentdate,origin,arrivestation,getcity,forwardingunit,receivingunit,transportid,transportCarid,waybillstatus,(page-1)*limit,limit);
    }

    /**
     * 运单详细
     *
     * @param consignmentid 运单号
     * @return 运单对象
     */
    @Override
    public Waybilllist idquery(String consignmentid) {
        return waybilllistMapper.idquery (consignmentid);
    }


}
